package com.eastmoney.emis.edda.infrastructure.account;

import com.eastmoney.emis.edda.infrastructure.account.mapper.AccountInfoRepository;
import com.eastmoney.emis.logger.LoggerFactory;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description: Description
 * @projectName: EDDA-HSBC
 * @package: com.eastmoney.emis.edda.infrastructure.account
 * @author: 汪程程
 * @date: 2022/10/21 10:51 AM
 * @version: 1.0
 */
@Service
public class AccountServiceImpl implements AccountService {

    private static final Logger log = LoggerFactory.getLogger(AccountServiceImpl.class);

    @Autowired
    private AccountInfoRepository repository;

    @Override
    public String getAccountCodeByClientId(String clientId) {
        return repository.findAccountCodeByClientId(clientId);
    }

    @Override
    public String getPhoneByClientId(String clientId) {
        return repository.findMobileByClientId(clientId);
    }

    @Override
    public boolean isAccountOpened(String clientId) {
        return repository.findOpenDateByClientId(clientId) != null;
    }
}
